home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / xemacs.info-10 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  47.6 KB  |  1,164 lines

  1. This is Info file ../../info/xemacs.info, produced by Makeinfo-1.63
  2. from the input file xemacs.texi.
  3.  
  4.    This file documents the XEmacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
  8. Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided also
  16. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  17. General Public License" are included exactly as in the original, and
  18. provided that the entire resulting derived work is distributed under the
  19. terms of a permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that the sections entitled "The GNU Manifesto",
  24. "Distribution" and "GNU General Public License" may be included in a
  25. translation approved by the author instead of in the original English.
  26.  
  27. 
  28. File: xemacs.info,  Node: Comments,  Next: Balanced Editing,  Prev: Matching,  Up: Programs
  29.  
  30. Manipulating Comments
  31. =====================
  32.  
  33.    The comment commands insert, kill and align comments.
  34.  
  35. `M-;'
  36.      Insert or align comment (`indent-for-comment').
  37.  
  38. `C-x ;'
  39.      Set comment column (`set-comment-column').
  40.  
  41. `C-u - C-x ;'
  42.      Kill comment on current line (`kill-comment').
  43.  
  44. `M-LFD'
  45.      Like RET followed by inserting and aligning a comment
  46.      (`indent-new-comment-line').
  47.  
  48.    The command that creates a comment is `Meta-;'
  49. (`indent-for-comment').  If there is no comment already on the line, a
  50. new comment is created and aligned at a specific column called the
  51. "comment column".  Emacs creates the comment by inserting the string at
  52. the value of `comment-start'; see below.  Point is left after that
  53. string.  If the text of the line extends past the comment column,
  54. indentation is done to a suitable boundary (usually, at least one space
  55. is inserted).  If the major mode has specified a string to terminate
  56. comments, that string is inserted after point, to keep the syntax valid.
  57.  
  58.    You can also use `Meta-;' to align an existing comment.  If a line
  59. already contains the string that starts comments, `M-;' just moves
  60. point after it and re-indents it to the conventional place.  Exception:
  61. comments starting in column 0 are not moved.
  62.  
  63.    Some major modes have special rules for indenting certain kinds of
  64. comments in certain contexts.  For example, in Lisp code, comments which
  65. start with two semicolons are indented as if they were lines of code,
  66. instead of at the comment column.  Comments which start with three
  67. semicolons are supposed to start at the left margin.  Emacs understands
  68. these conventions by indenting a double-semicolon comment using TAB and
  69. by not changing the indentation of a triple-semicolon comment at all.
  70.  
  71.      ;; This function is just an example.
  72.      ;;; Here either two or three semicolons are appropriate.
  73.      (defun foo (x)
  74.      ;;; And now, the first part of the function:
  75.        ;; The following line adds one.
  76.        (1+ x))           ; This line adds one.
  77.  
  78.    In C code, a comment preceded on its line by nothing but whitespace
  79. is indented like a line of code.
  80.  
  81.    Even when an existing comment is properly aligned, `M-;' is still
  82. useful for moving directly to the start of the comment.
  83.  
  84.    `C-u - C-x ;' (`kill-comment') kills the comment on the current
  85. line, if there is one.  The indentation before the start of the comment
  86. is killed as well.  If there does not appear to be a comment in the
  87. line, nothing happens.  To reinsert the comment on another line, move
  88. to the end of that line, type first `C-y', and then `M-;' to realign
  89. the comment.  Note that `C-u - C-x ;' is not a distinct key; it is `C-x
  90. ;' (`set-comment-column') with a negative argument.  That command is
  91. programmed to call `kill-comment' when called with a negative argument.
  92. However, `kill-comment' is a valid command which you could bind
  93. directly to a key if you wanted to.
  94.  
  95. Multiple Lines of Comments
  96. --------------------------
  97.  
  98.    If you are typing a comment and want to continue it on another line,
  99. use the command `Meta-LFD' (`indent-new-comment-line'), which
  100. terminates the comment you are typing, creates a new blank line
  101. afterward, and begins a new comment indented under the old one.  If
  102. Auto Fill mode is on and you go past the fill column while typing, the
  103. comment is continued in just this fashion.  If point is not at the end
  104. of the line when you type `M-LFD', the text on the rest of the line
  105. becomes part of the new comment line.
  106.  
  107. Options Controlling Comments
  108. ----------------------------
  109.  
  110.    The comment column is stored in the variable `comment-column'.  You
  111. can explicitly set it to a number.  Alternatively, the command `C-x ;'
  112. (`set-comment-column') sets the comment column to the column point is
  113. at.  `C-u C-x ;' sets the comment column to match the last comment
  114. before point in the buffer, and then calls `Meta-;' to align the
  115. current line's comment under the previous one.  Note that `C-u - C-x ;'
  116. runs the function `kill-comment' as described above.
  117.  
  118.    `comment-column' is a per-buffer variable; altering the variable
  119. affects only the current buffer.  You can also change the default value.
  120. *Note Locals::.  Many major modes initialize this variable for the
  121. current buffer.
  122.  
  123.    The comment commands recognize comments based on the regular
  124. expression that is the value of the variable `comment-start-skip'.
  125. This regexp should not match the null string.  It may match more than
  126. the comment starting delimiter in the strictest sense of the word; for
  127. example, in C mode the value of the variable is `"/\\*+ *"', which
  128. matches extra stars and spaces after the `/*' itself.  (Note that `\\'
  129. is needed in Lisp syntax to include a `\' in the string, which is needed
  130. to deny the first star its special meaning in regexp syntax.  *Note
  131. Regexps::.)
  132.  
  133.    When a comment command makes a new comment, it inserts the value of
  134. `comment-start' to begin it.  The value of `comment-end' is inserted
  135. after point and will follow the text you will insert into the comment.
  136. In C mode, `comment-start' has the value `"/* "' and `comment-end' has
  137. the value `" */"'.
  138.  
  139.    `comment-multi-line' controls how `M-LFD'
  140. (`indent-new-comment-line') behaves when used inside a comment.  If
  141. `comment-multi-line' is `nil', as it normally is, then `M-LFD'
  142. terminates the comment on the starting line and starts a new comment on
  143. the new following line.  If `comment-multi-line' is not `nil', then
  144. `M-LFD' sets up the new following line as part of the same comment that
  145. was found on the starting line.  This is done by not inserting a
  146. terminator on the old line and not inserting a starter on the new line.
  147. In languages where multi-line comments are legal, the value you choose
  148. for this variable is a matter of taste.
  149.  
  150.    The variable `comment-indent-hook' should contain a function that is
  151. called to compute the indentation for a newly inserted comment or for
  152. aligning an existing comment.  Major modes set this variable
  153. differently.  The function is called with no arguments, but with point
  154. at the beginning of the comment, or at the end of a line if a new
  155. comment is to be inserted.  The function should return the column in
  156. which the comment ought to start.  For example, in Lisp mode, the
  157. indent hook function bases its decision on the number of semicolons
  158. that begin an existing comment and on the code in the preceding lines.
  159.  
  160. 
  161. File: xemacs.info,  Node: Balanced Editing,  Next: Lisp Completion,  Prev: Comments,  Up: Programs
  162.  
  163. Editing Without Unbalanced Parentheses
  164. ======================================
  165.  
  166. `M-('
  167.      Put parentheses around next sexp(s) (`insert-parentheses').
  168.  
  169. `M-)'
  170.      Move past next close parenthesis and re-indent
  171.      (`move-over-close-and-reindent').
  172.  
  173.    The commands `M-(' (`insert-parentheses') and `M-)'
  174. (`move-over-close-
  175. and-reindent') are designed to facilitate a style of editing which
  176. keeps parentheses balanced at all times.  `M-(' inserts a pair of
  177. parentheses, either together as in `()', or, if given an argument,
  178. around the next several sexps, and leaves point after the open
  179. parenthesis.  Instead of typing `( F O O )', you can type `M-( F O O',
  180. which has the same effect except for leaving the cursor before the
  181. close parenthesis.  You can then type `M-)', which moves past the close
  182. parenthesis, deletes any indentation preceding it (in this example
  183. there is none), and indents with LFD after it.
  184.  
  185. 
  186. File: xemacs.info,  Node: Lisp Completion,  Next: Documentation,  Prev: Balanced Editing,  Up: Programs
  187.  
  188. Completion for Lisp Symbols
  189. ===========================
  190.  
  191.    Completion usually happens in the minibuffer.  An exception is
  192. completion for Lisp symbol names, which is available in all buffers.
  193.  
  194.    The command `M-TAB' (`lisp-complete-symbol') takes the partial Lisp
  195. symbol before point to be an abbreviation, and compares it against all
  196. non-trivial Lisp symbols currently known to Emacs.  Any additional
  197. characters that they all have in common are inserted at point.
  198. Non-trivial symbols are those that have function definitions, values, or
  199. properties.
  200.  
  201.    If there is an open-parenthesis immediately before the beginning of
  202. the partial symbol, only symbols with function definitions are
  203. considered as completions.
  204.  
  205.    If the partial name in the buffer has more than one possible
  206. completion and they have no additional characters in common, a list of
  207. all possible completions is displayed in another window.
  208.  
  209. 
  210. File: xemacs.info,  Node: Documentation,  Next: Change Log,  Prev: Lisp Completion,  Up: Programs
  211.  
  212. Documentation Commands
  213. ======================
  214.  
  215.    As you edit Lisp code to be run in Emacs, you can use the commands
  216. `C-h f' (`describe-function') and `C-h v' (`describe-variable') to
  217. print documentation of functions and variables you want to call.  These
  218. commands use the minibuffer to read the name of a function or variable
  219. to document, and display the documentation in a window.
  220.  
  221.    For extra convenience, these commands provide default arguments
  222. based on the code in the neighborhood of point.  `C-h f' sets the
  223. default to the function called in the innermost list containing point.
  224. `C-h v' uses the symbol name around or adjacent to point as its default.
  225.  
  226.    The `M-x manual-entry' command gives you access to documentation on
  227. Unix commands, system calls, and libraries.  The command reads a topic
  228. as an argument, and displays the Unix manual page for that topic.
  229. `manual-entry' always searches all 8 sections of the manual and
  230. concatenates all the entries it finds.  For example, the topic
  231. `termcap' finds the description of the termcap library from section 3,
  232. followed by the description of the termcap data base from section 5.
  233.  
  234. 
  235. File: xemacs.info,  Node: Change Log,  Next: Tags,  Prev: Documentation,  Up: Programs
  236.  
  237. Change Logs
  238. ===========
  239.  
  240.    The Emacs command `M-x add-change-log-entry' helps you keep a record
  241. of when and why you have changed a program.  It assumes that you have a
  242. file in which you write a chronological sequence of entries describing
  243. individual changes.  The default is to store the change entries in a
  244. file called `ChangeLog' in the same directory as the file you are
  245. editing.  The same `ChangeLog' file therefore records changes for all
  246. the files in a directory.
  247.  
  248.    A change log entry starts with a header line that contains your name
  249. and the current date.  Except for these header lines, every line in the
  250. change log starts with a tab.  One entry can describe several changes;
  251. each change starts with a line starting with a tab and a star.  `M-x
  252. add-change-log-entry' visits the change log file and creates a new entry
  253. unless the most recent entry is for today's date and your name.  In
  254. either case, it adds a new line to start the description of another
  255. change just after the header line of the entry.  When `M-x
  256. add-change-log-entry' is finished, all is prepared for you to edit in
  257. the description of what you changed and how.  You must then save the
  258. change log file yourself.
  259.  
  260.    The change log file is always visited in Indented Text mode, which
  261. means that LFD and auto-filling indent each new line like the previous
  262. line.  This is convenient for entering the contents of an entry, which
  263. must be indented.  *Note Text Mode::.
  264.  
  265.    Here is an example of the formatting conventions used in the change
  266. log for Emacs:
  267.  
  268.      Wed Jun 26 19:29:32 1985  Richard M. Stallman  (rms at mit-prep)
  269.      
  270.              * xdisp.c (try_window_id):
  271.              If C-k is done at end of next-to-last line,
  272.              this fn updates window_end_vpos and cannot leave
  273.              window_end_pos nonnegative (it is zero, in fact).
  274.              If display is preempted before lines are output,
  275.              this is inconsistent.  Fix by setting
  276.              blank_end_of_window to nonzero.
  277.      
  278.      Tue Jun 25 05:25:33 1985  Richard M. Stallman  (rms at mit-prep)
  279.      
  280.              * cmds.c (Fnewline):
  281.              Call the auto fill hook if appropriate.
  282.      
  283.              * xdisp.c (try_window_id):
  284.              If point is found by compute_motion after xp, record that
  285.              permanently.  If display_text_line sets point position wrong
  286.              (case where line is killed, point is at eob and that line is
  287.              not displayed), set it again in final compute_motion.
  288.  
  289. 
  290. File: xemacs.info,  Node: Tags,  Next: Fortran,  Prev: Change Log,  Up: Programs
  291.  
  292. Tag Tables
  293. ==========
  294.  
  295.    A "tag table" is a description of how a multi-file program is broken
  296. up into files.  It lists the names of the component files and the names
  297. and positions of the functions in each file.  Grouping the related
  298. files makes it possible to search or replace through all the files with
  299. one command.  Recording the function names and positions makes it
  300. possible to use the `Meta-.' command, which finds the definition of a
  301. function without asking for information on the file it is in.
  302.  
  303.    Tag tables are stored in files called "tag table files".  The
  304. conventional name for a tag table file is `TAGS'.
  305.  
  306.    Each entry in the tag table records the name of one tag, the name of
  307. the file that the tag is defined in (implicitly), and the position in
  308. that file of the tag's definition.
  309.  
  310.    The programming language of a file determines what names are recorded
  311. in the tag table depends on.  Normally, Emacs includes all functions and
  312. subroutines, and may also include global variables, data types, and
  313. anything else convenient.  Each recorded name is called a "tag".
  314.  
  315. * Menu:
  316.  
  317. * Tag Syntax::
  318. * Create Tag Table::
  319. * Select Tag Table::
  320. * Find Tag::
  321. * Tags Search::
  322. * Tags Stepping::
  323. * List Tags::
  324.  
  325. 
  326. File: xemacs.info,  Node: Tag Syntax,  Next: Create Tag Table,  Prev: Tags,  Up: Tags
  327.  
  328. Source File Tag Syntax
  329. ----------------------
  330.  
  331.    In Lisp code, any function defined with `defun', any variable
  332. defined with `defvar' or `defconst', and the first argument of any
  333. expression that starts with `(def' in column zero, is a tag.
  334.  
  335.    In C code, any C function is a tag, and so is any typedef if `-t' is
  336. specified when the tag table is constructed.
  337.  
  338.    In Fortran code, functions and subroutines are tags.
  339.  
  340.    In LaTeX text, the argument of any of the commands `\chapter',
  341. `\section', `\subsection', `\subsubsection', `\eqno', `\label', `\ref',
  342. `\cite', `\bibitem', and
  343. `\typeout' is a tag.
  344.  
  345. 
  346. File: xemacs.info,  Node: Create Tag Table,  Next: Select Tag Table,  Prev: Tag Syntax,  Up: Tags
  347.  
  348. Creating Tag Tables
  349. -------------------
  350.  
  351.    The `etags' program is used to create a tag table file.  It knows
  352. the syntax of C, Fortran, LaTeX, Scheme, and Emacs Lisp/Common Lisp.  To
  353. use `etags', use it as a shell command:
  354.  
  355.      etags INPUTFILES...
  356.  
  357. The program reads the specified files and writes a tag table named
  358. `TAGS' in the current working directory.  `etags' recognizes the
  359. language used in an input file based on the name and contents of the
  360. file; there are no switches for specifying the language.  The `-t'
  361. switch tells `etags' to record typedefs in C code as tags.
  362.  
  363.    If the tag table data become outdated due to changes in the files
  364. described in the table, you can update the tag table by running the
  365. program from the shell again.  It is not necessary to do this often.
  366.  
  367.    If the tag table fails to record a tag, or records it for the wrong
  368. file, Emacs cannot find its definition.  However, if the position
  369. recorded in the tag table becomes a little bit wrong (due to some
  370. editing in the file that the tag definition is in), the only
  371. consequence is to slow down finding the tag slightly.  Even if the
  372. stored position is very wrong, Emacs will still find the tag, but it
  373. must search the entire file for it.
  374.  
  375.    You should update a tag table when you define new tags you want to
  376. have listed, when you move tag definitions from one file to another, or
  377. when changes become substantial.  You don't have to update the tag
  378. table after each edit, or even every day.
  379.  
  380. 
  381. File: xemacs.info,  Node: Select Tag Table,  Next: Find Tag,  Prev: Create Tag Table,  Up: Tags
  382.  
  383. Selecting a Tag Table
  384. ---------------------
  385.  
  386.    At any time Emacs has one "selected" tag table, and all the commands
  387. for working with tag tables use the selected one.  To select a tag
  388. table, use the variable `tag-table-alist'.
  389.  
  390.    The value of `tag-table-alist' is a list that determines which
  391. `TAGS' files should be active for a given buffer.  This is not really
  392. an association list, in that all elements are checked.  The car of each
  393. element of this list is a pattern against which the buffers file name
  394. is compared; if it matches, then the cdr of the list should be the name
  395. of the tags table to use.  If more than one element of this list
  396. matches the buffers file name, all of the associated tags tables are
  397. used.  Earlier ones are searched first.
  398.  
  399.    If the car of elements of this list are strings, they are treated as
  400. regular-expressions against which the file is compared (like the
  401. `auto-mode-alist').  If they are not strings, they are evaluated.  If
  402. they evaluate to non-`nil', the current buffer is considered to match.
  403.  
  404.    If the cdr of the elements of this list are strings, they are
  405. assumed to name a tags file.  If they name a directory, the string
  406. `tags' is appended to them to get the file name.  If they are not
  407. strings, they are evaluated and must return an appropriate string.
  408.  
  409.    For example:
  410.  
  411.        (setq tag-table-alist
  412.          '(("/usr/src/public/perl/" . "/usr/src/public/perl/perl-3.0/")
  413.            ("\\.el$" . "/usr/local/emacs/src/")
  414.            ("/jbw/gnu/" . "/usr15/degree/stud/jbw/gnu/")
  415.            ("" . "/usr/local/emacs/src/")
  416.            ))
  417.  
  418.    The example defines the tag table alist in the following way:
  419.  
  420.    * Anything in the directory `/usr/src/public/perl/' should use the
  421.      `TAGS' file `/usr/src/public/perl/perl-3.0/TAGS'.
  422.  
  423.    * Files ending in `.el' should use the `TAGS' file
  424.      `/usr/local/emacs/src/TAGS'.
  425.  
  426.    * Anything in or below the directory `/jbw/gnu/' should use the
  427.      `TAGS' file `/usr15/degree/stud/jbw/gnu/TAGS'.
  428.  
  429.    If you had a file called `/usr/jbw/foo.el', it would use both `TAGS'
  430. files,
  431. `/usr/local/emacs/src/TAGS' and `/usr15/degree/stud/jbw/gnu/TAGS' (in
  432. that order), because it matches both patterns.
  433.  
  434.    If the buffer-local variable `buffer-tag-table' is set, it names a
  435. tags table that is searched before all others when `find-tag' is
  436. executed from this buffer.
  437.  
  438.    If there is a file called `TAGS' in the same directory as the file
  439. in question, then that tags file will always be used as well (after the
  440. `buffer-tag-table' but before the tables specified by this list).
  441.  
  442.    If the variable `tags-file-name' is set, the `TAGS' file it names
  443. will apply to all buffers (for backwards compatibility.)  It is searched
  444. first.
  445.  
  446.    If the value of the variable `tags-always-build-completion-table' is
  447. `t', the tags file will always be added to the completion table without
  448. asking first, regardless of the size of the tags file.
  449.  
  450.    The function `M-x visit-tags-table', is largely made obsolete by the
  451. variable `tag-table-alist', tells tags commands to use the tags table
  452. file FILE first.  The FILE should be the name of a file created with
  453. the `etags' program.  A directory name is also acceptable; it means the
  454. file `TAGS' in that directory.  The function only stores the file name
  455. you provide in the variable `tags-file-name'.  Emacs does not actually
  456. read in the tag table contents until you try to use them.  You can set
  457. the variable explicitly instead of using `visit-tags-table'.  The value
  458. of the variable `tags-file-name' is the name of the tags table used by
  459. all buffers.  This is for backward compatibility, and is largely
  460. supplanted by the variable `tag-table-alist'.
  461.  
  462. 
  463. File: xemacs.info,  Node: Find Tag,  Next: Tags Search,  Prev: Select Tag Table,  Up: Tags
  464.  
  465. Finding a Tag
  466. -------------
  467.  
  468.    The most important thing that a tag table enables you to do is to
  469. find the definition of a specific tag.
  470.  
  471. `M-. TAG &OPTIONAL OTHER-WINDOW'
  472.      Find first definition of TAG (`find-tag').
  473.  
  474. `C-u M-.'
  475.      Find next alternate definition of last tag specified.
  476.  
  477. `C-x 4 . TAG'
  478.      Find first definition of TAG, but display it in another window
  479.      (`find-tag-other-window').
  480.  
  481.    `M-.' (`find-tag') is the command to find the definition of a
  482. specified tag.  It searches through the tag table for that tag, as a
  483. string, then uses the tag table information to determine the file in
  484. which the definition is used and the approximate character position of
  485. the definition in the file.  Then `find-tag' visits the file, moves
  486. point to the approximate character position, and starts searching
  487. ever-increasing distances away for the text that should appear at the
  488. beginning of the definition.
  489.  
  490.    If an empty argument is given (by typing RET), the sexp in the
  491. buffer before or around point is used as the name of the tag to find.
  492. *Note Lists::, for information on sexps.
  493.  
  494.    The argument to `find-tag' need not be the whole tag name; it can be
  495. a substring of a tag name.  However, there can be many tag names
  496. containing the substring you specify.  Since `find-tag' works by
  497. searching the text of the tag table, it finds the first tag in the table
  498. that the specified substring appears in.  To find other tags that match
  499. the substring, give `find-tag' a numeric argument, as in `C-u M-.'.
  500. This does not read a tag name, but continues searching the tag table's
  501. text for another tag containing the same substring last used.  If your
  502. keyboard has a real META key, `M-0 M-.' is an easier alternative to
  503. `C-u M-.'.
  504.  
  505.    If the optional second argument OTHER-WINDOW is non-`nil', it uses
  506. another window to display the tag.  Multiple active tags tables and
  507. completion are supported.
  508.  
  509.    Variables of note include the following:
  510.  
  511. `tag-table-alist'
  512.      Controls which tables apply to which buffers.
  513.  
  514. `tags-file-name'
  515.      Stores a default tags table.
  516.  
  517. `tags-build-completion-table'
  518.      Controls completion behavior.
  519.  
  520. `buffer-tag-table'
  521.      Specifies a buffer-local table.
  522.  
  523. `make-tags-files-invisible'
  524.      Sets whether tags tables should be very hidden.
  525.  
  526. `tag-mark-stack-max'
  527.      Specifies how many tags-based hops to remember.
  528.  
  529.    Like most commands that can switch buffers, `find-tag' has another
  530. similar command that displays the new buffer in another window.  `C-x 4
  531. .' invokes the function `find-tag-other-window'.  (This key sequence
  532. ends with a period.)
  533.  
  534.    Emacs comes with a tag table file `TAGS' (in the directory
  535. containing Lisp libraries) that includes all the Lisp libraries and all
  536. the C sources of Emacs.  By specifying this file with `visit-tags-table'
  537. and then using `M-.' you can quickly look at the source of any Emacs
  538. function.
  539.  
  540. 
  541. File: xemacs.info,  Node: Tags Search,  Next: Tags Stepping,  Prev: Find Tag,  Up: Tags
  542.  
  543. Searching and Replacing with Tag Tables
  544. ---------------------------------------
  545.  
  546.    The commands in this section visit and search all the files listed
  547. in the selected tag table, one by one.  For these commands, the tag
  548. table serves only to specify a sequence of files to search.  A related
  549. command is `M-x grep' (*note Compilation::.).
  550.  
  551. `M-x tags-search'
  552.      Search for the specified regexp through the files in the selected
  553.      tag table.
  554.  
  555. `M-x tags-query-replace'
  556.      Perform a `query-replace' on each file in the selected tag table.
  557.  
  558. `M-,'
  559.      Restart one of the commands above, from the current location of
  560.      point (`tags-loop-continue').
  561.  
  562.    `M-x tags-search' reads a regexp using the minibuffer, then visits
  563. the files of the selected tag table one by one, and searches through
  564. each file for that regexp.  It displays the name of the file being
  565. searched so you can follow its progress.  As soon as an occurrence is
  566. found, `tags-search' returns.
  567.  
  568.    After you have found one match, you probably want to find all the
  569. rest.  To find one more match, type `M-,' (`tags-loop-continue') to
  570. resume the `tags-search'.  This searches the rest of the current
  571. buffer, followed by the remaining files of the tag table.
  572.  
  573.    `M-x tags-query-replace' performs a single `query-replace' through
  574. all the files in the tag table.  It reads a string to search for and a
  575. string to replace with, just like ordinary `M-x query-replace'.  It
  576. searches much like `M-x tags-search' but repeatedly, processing matches
  577. according to your input.  *Note Replace::, for more information on
  578. `query-replace'.
  579.  
  580.    It is possible to get through all the files in the tag table with a
  581. single invocation of `M-x tags-query-replace'.  But since any
  582. unrecognized character causes the command to exit, you may need to
  583. continue from where you left off.  You can use `M-,' to do this.  It
  584. resumes the last tags search or replace command that you did.
  585.  
  586.    It may have struck you that `tags-search' is a lot like `grep'.  You
  587. can also run `grep' itself as an inferior of Emacs and have Emacs show
  588. you the matching lines one by one.  This works mostly the same as
  589. running a compilation and having Emacs show you where the errors were.
  590. *Note Compilation::.
  591.  
  592. 
  593. File: xemacs.info,  Node: Tags Stepping,  Next: List Tags,  Prev: Tags Search,  Up: Tags
  594.  
  595. Stepping Through a Tag Table
  596. ----------------------------
  597.  
  598.    If you wish to process all the files in a selected tag table, but
  599. `M-x tags-search' and `M-x tags-query-replace' are not giving you the
  600. desired result, you can use `M-x next-file'.
  601.  
  602. `C-u M-x next-file'
  603.      With a numeric argument, regardless of its value, visit the first
  604.      file in the tag table and prepare to advance sequentially by files.
  605.  
  606. `M-x next-file'
  607.      Visit the next file in the selected tag table.
  608.  
  609. 
  610. File: xemacs.info,  Node: List Tags,  Prev: Tags Stepping,  Up: Tags
  611.  
  612. Tag Table Inquiries
  613. -------------------
  614.  
  615. `M-x list-tags'
  616.      Display a list of the tags defined in a specific program file.
  617.  
  618. `M-x tags-apropos'
  619.      Display a list of all tags matching a specified regexp.
  620.  
  621.    `M-x list-tags' reads the name of one of the files described by the
  622. selected tag table, and displays a list of all the tags defined in that
  623. file.  The "file name" argument is really just a string to compare
  624. against the names recorded in the tag table; it is read as a string
  625. rather than a file name.  Therefore, completion and defaulting are not
  626. available, and you must enter the string the same way it appears in the
  627. tag table.  Do not include a directory as part of the file name unless
  628. the file name recorded in the tag table contains that directory.
  629.  
  630.    `M-x tags-apropos' is like `apropos' for tags.  It reads a regexp,
  631. then finds all the tags in the selected tag table whose entries match
  632. that regexp, and displays the tag names found.
  633.  
  634. 
  635. File: xemacs.info,  Node: Fortran,  Next: Asm Mode,  Prev: Tags,  Up: Programs
  636.  
  637. Fortran Mode
  638. ============
  639.  
  640.    Fortran mode provides special motion commands for Fortran statements
  641. and subprograms, and indentation commands that understand Fortran
  642. conventions of nesting, line numbers, and continuation statements.
  643.  
  644.    Special commands for comments are provided because Fortran comments
  645. are unlike those of other languages.
  646.  
  647.    Built-in abbrevs optionally save typing when you insert Fortran
  648. keywords.
  649.  
  650.    Use `M-x fortran-mode' to switch to this major mode.  Doing so calls
  651. the value of `fortran-mode-hook' as a function of no arguments if that
  652. variable has a non-`nil' value.
  653.  
  654. * Menu:
  655.  
  656. * Motion: Fortran Motion.     Moving point by statements or subprograms.
  657. * Indent: Fortran Indent.     Indentation commands for Fortran.
  658. * Comments: Fortran Comments. Inserting and aligning comments.
  659. * Columns: Fortran Columns.   Measuring columns for valid Fortran.
  660. * Abbrev: Fortran Abbrev.     Built-in abbrevs for Fortran keywords.
  661.  
  662.    Fortran mode was contributed by Michael Prange.
  663.  
  664. 
  665. File: xemacs.info,  Node: Fortran Motion,  Next: Fortran Indent,  Prev: Fortran,  Up: Fortran
  666.  
  667. Motion Commands
  668. ---------------
  669.  
  670.    Fortran mode provides special commands to move by subprograms
  671. (functions and subroutines) and by statements.  There is also a command
  672. to put the region around one subprogram, which is convenient for
  673. killing it or moving it.
  674.  
  675. `C-M-a'
  676.      Move to beginning of subprogram
  677.      (`beginning-of-fortran-subprogram').
  678.  
  679. `C-M-e'
  680.      Move to end of subprogram (`end-of-fortran-subprogram').
  681.  
  682. `C-M-h'
  683.      Put point at beginning of subprogram and mark at end
  684.      (`mark-fortran-subprogram').
  685.  
  686. `C-c C-n'
  687.      Move to beginning of current or next statement (`fortran-next-
  688.      statement').
  689.  
  690. `C-c C-p'
  691.      Move to beginning of current or previous statement (`fortran-
  692.      previous-statement').
  693.  
  694. 
  695. File: xemacs.info,  Node: Fortran Indent,  Next: Fortran Comments,  Prev: Fortran Motion,  Up: Fortran
  696.  
  697. Fortran Indentation
  698. -------------------
  699.  
  700.    Special commands and features are available for indenting Fortran
  701. code.  They make sure various syntactic entities (line numbers, comment
  702. line indicators, and continuation line flags) appear in the columns
  703. that are required for standard Fortran.
  704.  
  705. * Menu:
  706.  
  707. * Commands: ForIndent Commands. Commands for indenting Fortran.
  708. * Numbers:  ForIndent Num.      How line numbers auto-indent.
  709. * Conv:     ForIndent Conv.     Conventions you must obey to avoid trouble.
  710. * Vars:     ForIndent Vars.     Variables controlling Fortran indent style.
  711.  
  712. 
  713. File: xemacs.info,  Node: ForIndent Commands,  Next: ForIndent Num,  Prev: Fortran Indent,  Up: Fortran Indent
  714.  
  715. Fortran Indentation Commands
  716. ............................
  717.  
  718. `TAB'
  719.      Indent the current line (`fortran-indent-line').
  720.  
  721. `M-LFD'
  722.      Break the current line and set up a continuation line.
  723.  
  724. `C-M-q'
  725.      Indent all the lines of the subprogram point is in
  726.      (`fortran-indent-subprogram').
  727.  
  728.    TAB is redefined by Fortran mode to reindent the current line for
  729. Fortran (`fortran-indent-line').  Line numbers and continuation markers
  730. are indented to their required columns, and the body of the statement
  731. is independently indented, based on its nesting in the program.
  732.  
  733.    The key `C-M-q' is redefined as `fortran-indent-subprogram', a
  734. command that reindents all the lines of the Fortran subprogram
  735. (function or subroutine) containing point.
  736.  
  737.    The key `M-LFD' is redefined as `fortran-split-line', a command to
  738. split a line in the appropriate fashion for Fortran.  In a non-comment
  739. line, the second half becomes a continuation line and is indented
  740. accordingly.  In a comment line, both halves become separate comment
  741. lines.
  742.  
  743. 
  744. File: xemacs.info,  Node: ForIndent Num,  Next: ForIndent Conv,  Prev: ForIndent Commands,  Up: Fortran Indent
  745.  
  746. Line Numbers and Continuation
  747. .............................
  748.  
  749.    If a number is the first non-whitespace in the line, it is assumed
  750. to be a line number and is moved to columns 0 through 4.  (Columns are
  751. always counted from 0 in XEmacs.)  If the text on the line starts with
  752. the conventional Fortran continuation marker `$', it is moved to column
  753. 5.  If the text begins with any non whitespace character in column 5,
  754. it is assumed to be an unconventional continuation marker and remains
  755. in column 5.
  756.  
  757.    Line numbers of four digits or less are normally indented one space.
  758. This amount is controlled by the variable `fortran-line-number-indent',
  759. which is the maximum indentation a line number can have.  Line numbers
  760. are indented to right-justify them to end in column 4 unless that would
  761. require more than the maximum indentation.  The default value of the
  762. variable is 1.
  763.  
  764.    Simply inserting a line number is enough to indent it according to
  765. these rules.  As each digit is inserted, the indentation is recomputed.
  766. To turn off this feature, set the variable
  767. `fortran-electric-line-number' to `nil'.  Then inserting line numbers
  768. is like inserting anything else.
  769.  
  770. 
  771. File: xemacs.info,  Node: ForIndent Conv,  Next: ForIndent Vars,  Prev: ForIndent Num,  Up: Fortran Indent
  772.  
  773. Syntactic Conventions
  774. .....................
  775.  
  776.    Fortran mode assumes that you follow certain conventions that
  777. simplify the task of understanding a Fortran program well enough to
  778. indent it properly:
  779.  
  780.    * Two nested `do' loops never share a `continue' statement.
  781.  
  782.    * The same character appears in column 5 of all continuation lines.
  783.      It is the value of the variable `fortran-continuation-char'.  By
  784.      default, this character is `$'.
  785.  
  786. If you fail to follow these conventions, the indentation commands may
  787. indent some lines unaesthetically.  However, a correct Fortran program
  788. will retain its meaning when reindented even if the conventions are not
  789. followed.
  790.  
  791. 
  792. File: xemacs.info,  Node: ForIndent Vars,  Prev: ForIndent Conv,  Up: Fortran Indent
  793.  
  794. Variables for Fortran Indentation
  795. .................................
  796.  
  797.    Several additional variables control how Fortran indentation works.
  798.  
  799. `fortran-do-indent'
  800.      Extra indentation within each level of `do' statement (the default
  801.      is 3).
  802.  
  803. `fortran-if-indent'
  804.      Extra indentation within each level of `if' statement (the default
  805.      is 3).
  806.  
  807. `fortran-continuation-indent'
  808.      Extra indentation for bodies of continuation lines (the default is
  809.      5).
  810.  
  811. `fortran-check-all-num-for-matching-do'
  812.      If this is `nil', indentation assumes that each `do' statement
  813.      ends on a `continue' statement.  Therefore, when computing
  814.      indentation for a statement other than `continue', it can save
  815.      time by not checking for a `do' statement ending there.  If this
  816.      is non-`nil', indenting any numbered statement must check for a
  817.      `do' that ends there.  The default is `nil'.
  818.  
  819. `fortran-minimum-statement-indent'
  820.      Minimum indentation for Fortran statements.  For standard Fortran,
  821.      this is 6.  Statement bodies are always indented at least this
  822.      much.
  823.  
  824. 
  825. File: xemacs.info,  Node: Fortran Comments,  Next: Fortran Columns,  Prev: Fortran Indent,  Up: Fortran
  826.  
  827. Comments
  828. --------
  829.  
  830.    The usual Emacs comment commands assume that a comment can follow a
  831. line of code.  In Fortran, the standard comment syntax requires an
  832. entire line to be just a comment.  Therefore, Fortran mode replaces the
  833. standard Emacs comment commands and defines some new variables.
  834.  
  835.    Fortran mode can also handle a non-standard comment syntax where
  836. comments start with `!' and can follow other text.  Because only some
  837. Fortran compilers accept this syntax, Fortran mode will not insert such
  838. comments unless you have specified to do so in advance by setting the
  839. variable `comment-start' to `"!"' (*note Variables::.).
  840.  
  841. `M-;'
  842.      Align comment or insert new comment (`fortran-comment-indent').
  843.  
  844. `C-x ;'
  845.      Applies to nonstandard `!' comments only.
  846.  
  847. `C-c ;'
  848.      Turn all lines of the region into comments, or (with arg) turn
  849.      them back into real code (`fortran-comment-region').
  850.  
  851.    `M-;' in Fortran mode is redefined as the command
  852. `fortran-comment-indent'.  Like the usual `M-;' command, it recognizes
  853. an existing comment and aligns its text appropriately.  If there is no
  854. existing comment, a comment is inserted and aligned.
  855.  
  856.    Inserting and aligning comments is not the same in Fortran mode as in
  857. other modes.  When a new comment must be inserted, a full-line comment
  858. is inserted if the current line is blank.  On a non-blank line, a
  859. non-standard `!' comment is inserted if you previously specified you
  860. wanted to use them.  Otherwise a full-line comment is inserted on a new
  861. line before the current line.
  862.  
  863.    Non-standard `!' comments are aligned like comments in other
  864. languages, but full-line comments are aligned differently.  In a
  865. standard full-line comment, the comment delimiter itself must always
  866. appear in column zero.  What can be aligned is the text within the
  867. comment.  You can choose from three styles of alignment by setting the
  868. variable `fortran-comment-indent-style' to one of these values:
  869.  
  870. `fixed'
  871.      The text is aligned at a fixed column, which is the value of
  872.      `fortran-comment-line-column'.  This is the default.
  873.  
  874. `relative'
  875.      The text is aligned as if it were a line of code, but with an
  876.      additional `fortran-comment-line-column' columns of indentation.
  877.  
  878. `nil'
  879.      Text in full-line columns is not moved automatically.
  880.  
  881.    You can also specify the character to be used to indent within
  882. full-line comments by setting the variable `fortran-comment-indent-char'
  883. to the character you want to use.
  884.  
  885.    Fortran mode introduces two variables `comment-line-start' and
  886. `comment-line-start-skip', which do for full-line comments what
  887. `comment-start' and `comment-start-skip' do for ordinary text-following
  888. comments.  Normally these are set properly by Fortran mode, so you do
  889. not need to change them.
  890.  
  891.    The normal Emacs comment command `C-x ;' has not been redefined.  It
  892. can therefore be used if you use `!' comments, but is useless in
  893. Fortran mode otherwise.
  894.  
  895.    The command `C-c ;' (`fortran-comment-region') turns all the lines
  896. of the region into comments by inserting the string `C$$$' at the front
  897. of each one.  With a numeric arg, the region is turned back into live
  898. code by deleting `C$$$' from the front of each line.  You can control
  899. the string used for the comments by setting the variable
  900. `fortran-comment-region'.  Note that here we have an example of a
  901. command and a variable with the same name; the two uses of the name
  902. never conflict because in Lisp and in Emacs it is always clear from the
  903. context which one is referred to.
  904.  
  905. 
  906. File: xemacs.info,  Node: Fortran Columns,  Next: Fortran Abbrev,  Prev: Fortran Comments,  Up: Fortran
  907.  
  908. Columns
  909. -------
  910.  
  911. `C-c C-r'
  912.      Displays a "column ruler" momentarily above the current line
  913.      (`fortran-column-ruler').
  914.  
  915. `C-c C-w'
  916.      Splits the current window horizontally so that it is 72 columns
  917.      wide.  This may help you avoid going over that limit
  918.      (`fortran-window-create').
  919.  
  920.    The command `C-c C-r' (`fortran-column-ruler') shows a column ruler
  921. above the current line.  The comment ruler consists of two lines of
  922. text that show you the locations of columns with special significance
  923. in Fortran programs.  Square brackets show the limits of the columns for
  924. line numbers, and curly brackets show the limits of the columns for the
  925. statement body.  Column numbers appear above them.
  926.  
  927.    Note that the column numbers count from zero, as always in XEmacs.
  928. As a result, the numbers may not be those you are familiar with; but the
  929. actual positions in the line are standard Fortran.
  930.  
  931.    The text used to display the column ruler is the value of the
  932. variable `fortran-comment-ruler'.  By changing this variable, you can
  933. change the display.
  934.  
  935.    For even more help, use `C-c C-w' (`fortran-window-create'), a
  936. command which splits the current window horizontally, resulting in a
  937. window 72 columns wide.  When you edit in this window, you can
  938. immediately see when a line gets too wide to be correct Fortran.
  939.  
  940. 
  941. File: xemacs.info,  Node: Fortran Abbrev,  Prev: Fortran Columns,  Up: Fortran
  942.  
  943. Fortran Keyword Abbrevs
  944. -----------------------
  945.  
  946.    Fortran mode provides many built-in abbrevs for common keywords and
  947. declarations.  These are the same sort of abbrevs that you can define
  948. yourself.  To use them, you must turn on Abbrev mode.  *note Abbrevs::..
  949.  
  950.    The built-in abbrevs are unusual in one way: they all start with a
  951. semicolon.  You cannot normally use semicolon in an abbrev, but Fortran
  952. mode makes this possible by changing the syntax of semicolon to "word
  953. constituent".
  954.  
  955.    For example, one built-in Fortran abbrev is `;c' for `continue'.  If
  956. you insert `;c' and then insert a punctuation character such as a space
  957. or a newline, the `;c' changes automatically to `continue', provided
  958. Abbrev mode is enabled.
  959.  
  960.    Type `;?' or `;C-h' to display a list of all built-in Fortran
  961. abbrevs and what they stand for.
  962.  
  963. 
  964. File: xemacs.info,  Node: Asm Mode,  Prev: Fortran,  Up: Programs
  965.  
  966. Asm Mode
  967. ========
  968.  
  969.    Asm mode is a major mode for editing files of assembler code.  It
  970. defines these commands:
  971.  
  972. `TAB'
  973.      `tab-to-tab-stop'.
  974.  
  975. `LFD'
  976.      Insert a newline and then indent using `tab-to-tab-stop'.
  977.  
  978. `:'
  979.      Insert a colon and then remove the indentation from before the
  980.      label preceding colon.  Then do `tab-to-tab-stop'.
  981.  
  982. `;'
  983.      Insert or align a comment.
  984.  
  985.    The variable `asm-comment-char' specifies which character starts
  986. comments in assembler syntax.
  987.  
  988. 
  989. File: xemacs.info,  Node: Running,  Next: Abbrevs,  Prev: Programs,  Up: Top
  990.  
  991. Compiling and Testing Programs
  992. ******************************
  993.  
  994.    The previous chapter discusses the Emacs commands that are useful for
  995. making changes in programs.  This chapter deals with commands that
  996. assist in the larger process of developing and maintaining programs.
  997.  
  998. * Menu:
  999.  
  1000. * Compilation::        Compiling programs in languages other than Lisp
  1001.                         (C, Pascal, etc.)
  1002. * Modes: Lisp Modes.   Various modes for editing Lisp programs, with
  1003.                        different facilities for running the Lisp programs.
  1004. * Libraries: Lisp Libraries.      Creating Lisp programs to run in Emacs.
  1005. * Eval: Lisp Eval.     Executing a single Lisp expression in Emacs.
  1006. * Debug: Lisp Debug.   Debugging Lisp programs running in Emacs.
  1007. * Interaction: Lisp Interaction.  Executing Lisp in an Emacs buffer.
  1008. * External Lisp::      Communicating through Emacs with a separate Lisp.
  1009.  
  1010. 
  1011. File: xemacs.info,  Node: Compilation,  Next: Lisp Modes,  Prev: Running,  Up: Running
  1012.  
  1013. Running `make', or Compilers Generally
  1014. ======================================
  1015.  
  1016.    Emacs can run compilers for non-interactive languages like C and
  1017. Fortran as inferior processes, feeding the error log into an Emacs
  1018. buffer.  It can also parse the error messages and visit the files in
  1019. which errors are found, moving point to the line where the error
  1020. occurred.
  1021.  
  1022. `M-x compile'
  1023.      Run a compiler asynchronously under Emacs, with error messages to
  1024.      `*compilation*' buffer.
  1025.  
  1026. `M-x grep'
  1027.      Run `grep' asynchronously under Emacs, with matching lines listed
  1028.      in the buffer named `*compilation*'.
  1029.  
  1030. `M-x kill-compilation'
  1031.      Kill the process made by the `M-x compile' command.
  1032.  
  1033. `M-x kill-grep'
  1034.      Kill the running compilation or `grep' subprocess.
  1035.  
  1036. `C-x `'
  1037.      Visit the next compiler error message or `grep' match.
  1038.  
  1039.    To run `make' or another compiler, type `M-x compile'.  This command
  1040. reads a shell command line using the minibuffer, then executes the
  1041. specified command line in an inferior shell with output going to the
  1042. buffer named `*compilation*'.  By default, the current buffer's default
  1043. directory is used as the working directory for the execution of the
  1044. command; therefore, the makefile comes from this directory.
  1045.  
  1046.    When the shell command line is read, the minibuffer appears
  1047. containing a default command line (the command you used the last time
  1048. you typed `M-x compile').  If you type just RET, the same command line
  1049. is used again.  The first `M-x compile' provides `make -k' as the
  1050. default.  The default is taken from the variable `compile-command'; if
  1051. the appropriate compilation command for a file is something other than
  1052. `make -k', it can be useful to have the file specify a local value for
  1053. `compile-command' (*note File Variables::.).
  1054.  
  1055.    When you start a compilation, the buffer `*compilation*' is
  1056. displayed in another window but not selected.  Its mode line displays
  1057. the word `run' or `exit' in the parentheses to tell you whether
  1058. compilation is finished.  You do not have to keep this buffer visible;
  1059. compilation continues in any case.
  1060.  
  1061.    To kill the compilation process, type `M-x-kill-compilation'.  The
  1062. mode line of the `*compilation*' buffer changes to say `signal' instead
  1063. of `run'.  Starting a new compilation also kills any running
  1064. compilation, as only one can occur at any time.  Starting a new
  1065. compilation prompts for confirmation before actually killing a
  1066. compilation that is running.
  1067.  
  1068.    To parse the compiler error messages, type `C-x `' (`next-error').
  1069. The character following `C-x' is the grave accent, not the single
  1070. quote.  The command displays the buffer `*compilation*' in one window
  1071. and the buffer in which the next error occurred in another window.
  1072. Point in that buffer is moved to the line where the error was found.
  1073. The corresponding error message is scrolled to the top of the window in
  1074. which `*compilation*' is displayed.
  1075.  
  1076.    The first time you use `C-x `' after the start of a compilation, it
  1077. parses all the error messages, visits all the files that have error
  1078. messages, and creates markers pointing at the lines the error messages
  1079. refer to.  It then moves to the first error message location.
  1080. Subsequent uses of `C-x `' advance down the data set up by the first
  1081. use.  When the preparsed error messages are exhausted, the next `C-x `'
  1082. checks for any more error messages that have come in; this is useful if
  1083. you start editing compiler errors while compilation is still going on.
  1084. If no additional error messages have come in, `C-x `' reports an error.
  1085.  
  1086.    `C-u C-x `' discards the preparsed error message data and parses the
  1087. `*compilation*' buffer again, then displays the first error.  This way,
  1088. you can process the same set of errors again.
  1089.  
  1090.    Instead of running a compiler, you can run `grep' and see the lines
  1091. on which matches were found.  To do this, type `M-x grep' with an
  1092. argument line that contains the same arguments you would give to
  1093. `grep': a `grep'-style regexp (usually in single quotes to quote the
  1094. shell's special characters) followed by filenames, which may use
  1095. wildcard characters.  The output from `grep' goes in the
  1096. `*compilation*' buffer.  You can use `C-x `' to find the lines that
  1097. match as if they were compilation errors.
  1098.  
  1099.    Note: a shell is used to run the compile command, but the shell is
  1100. not run in interactive mode.  In particular, this means that the shell
  1101. starts up with no prompt.  If you find your usual shell prompt making an
  1102. unsightly appearance in the `*compilation*' buffer, it means you have
  1103. made a mistake in your shell's initialization file (`.cshrc' or `.shrc'
  1104. or ...) by setting the prompt unconditionally.  The shell
  1105. initialization file should set the prompt only if there already is a
  1106. prompt.  Here's how to do it in `csh':
  1107.  
  1108.      if ($?prompt) set prompt = ...
  1109.  
  1110. 
  1111. File: xemacs.info,  Node: Lisp Modes,  Next: Lisp Libraries,  Prev: Compilation,  Up: Running
  1112.  
  1113. Major Modes for Lisp
  1114. ====================
  1115.  
  1116.    Emacs has four different major modes for Lisp.  They are the same in
  1117. terms of editing commands, but differ in the commands for executing Lisp
  1118. expressions.
  1119.  
  1120. Emacs-Lisp mode
  1121.      The mode for editing source files of programs to run in Emacs Lisp.
  1122.      This mode defines `C-M-x' to evaluate the current defun.  *Note
  1123.      Lisp Libraries::.
  1124.  
  1125. Lisp Interaction mode
  1126.      The mode for an interactive session with Emacs Lisp.  It defines
  1127.      LFD to evaluate the sexp before point and insert its value in the
  1128.      buffer.  *Note Lisp Interaction::.
  1129.  
  1130. Lisp mode
  1131.      The mode for editing source files of programs that run in other
  1132.      dialects of Lisp than Emacs Lisp.  This mode defines `C-M-x' to
  1133.      send the current defun to an inferior Lisp process.  *Note
  1134.      External Lisp::.
  1135.  
  1136. Inferior Lisp mode
  1137.      The mode for an interactive session with an inferior Lisp process.
  1138.      This mode combines the special features of Lisp mode and Shell mode
  1139.      (*note Shell Mode::.).
  1140.  
  1141. Scheme mode
  1142.      Like Lisp mode but for Scheme programs.
  1143.  
  1144. Inferior Scheme mode
  1145.      The mode for an interactive session with an inferior Scheme
  1146.      process.
  1147.  
  1148. 
  1149. File: xemacs.info,  Node: Lisp Libraries,  Next: Lisp Eval,  Prev: Lisp Modes,  Up: Running
  1150.  
  1151. Libraries of Lisp Code for Emacs
  1152. ================================
  1153.  
  1154.    Lisp code for Emacs editing commands is stored in files whose names
  1155. conventionally end in `.el'.  This ending tells Emacs to edit them in
  1156. Emacs-Lisp mode (*note Lisp Modes::.).
  1157.  
  1158. * Menu:
  1159.  
  1160. * Loading::        Loading libraries of Lisp code into Emacs for use.
  1161. * Compiling Libraries:: Compiling a library makes it load and run faster.
  1162. * Mocklisp::        Converting Mocklisp to Lisp so XEmacs can run it.
  1163.  
  1164.